package acwing.周赛;/**
 * @author： li
 * @date： 2022-03-20 21:10
 * @version 1.0
 */
import java.util.*;
public class 农田灌溉{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        HashSet<Integer> ha = new HashSet<>();
        int t = sc.nextInt();
        int n,k;
        while(t>0){
            n=sc.nextInt();
            k=sc.nextInt();
            int[] a=new int[k+1];
            int max=a[1],min=a[1];
            for(int i=1;i<=k;i++){
                a[i]=sc.nextInt();
            }
            int j=1; boolean flag=true;
            while(flag){
                for(int i=1;i<=k;i++){
                    if(a[i]-(j-1)>0)
                    min=a[i]-(j-1);
                    if(a[i]+(j-1)<=n)
                    max=a[i]+(j-1);
                    ha.add(min);
                    ha.add(max);
                }
                if(ha.size()==n){
                    System.out.println(j);
                    j=1;
                    ha.clear();
                    flag=false;
                }
                j++;
            }
            t--;
        }
    }
}